package com.fulu.game.bi.entity.vo;

import com.fulu.game.bi.entity.enums.ResultStatus;
import lombok.Data;

@Data
public class Result<T> {

    private int status;
    private String msg = "";
    private T data;

    public Result() {
    }

    public Result msg(String msg) {
        this.msg = msg;
        return this;
    }

    public Result data(T data) {
        this.data = data;
        return this;
    }

    public static Result success() {
        Result result = new Result();
        result.setStatus(ResultStatus.SUCCESS);
        return result;
    }

    public static Result error() {
        Result result = new Result();
        result.setStatus(ResultStatus.ERROR);
        return result;
    }

    public static Result nologin() {
        Result result = new Result();
        result.setStatus(ResultStatus.NOLOGIN);
        return result;
    }
}
